<template>
	<view class="OrderSetup">
		<statusBar />
		<!-- 设置 -->
		<view @tap="leftIndex" class="nav">
			<image src="../../static/setup/jiantou.png" mode=""></image>
			<view>设置-订单设置-预订单设置</view>
		</view>
		<view class="stores">
			<view>
				<view>
					<view>手动自动接单</view>
					<view><u-switch v-model="checked" @change="change"></u-switch></view>
				</view>
				<view>时间段和营业时间一致(周一、周二、周三、周四、周日 03:05-05:09,06:00-10:00,13:00-23:00 )</view>
				<view>
					<view><image src="../../static/setup/gouxuan.png" mode=""></image></view>
					<view>Android系统版本需高于4.3</view>
				</view>
				<view>
					<view>
						<view><image src="../../static/setup/gouxuan.png" mode=""></image></view>
						<view>需授权通知使用权</view>
					</view>
					<view><image src="../../components/min-collapse/arrow.png" mode=""></image></view>
				</view>
				<!-- 打印机 -->
				<view>
					<view>
						<view><image src="../../static/setup/shanchu.png" mode=""></image></view>
						<view>需连接蓝牙打印机</view>
					</view>
					<view>
						<view>去连接</view>
						<view><image src="../../components/min-collapse/arrow.png" mode=""></image></view>
					</view>
				</view>
				<!-- 需设置不自动锁屏 -->
				<view>
					<view>
						<view><image src="../../static/setup/shanchu.png" mode=""></image></view>
						<view>需设置不自动锁屏</view>
					</view>
					<view>
						<view>去开启</view>
						<view><image src="../../components/min-collapse/arrow.png" mode=""></image></view>
					</view>
				</view>
				<!-- 文字 -->
				<view>
					
					1. 保证打印机不缺纸<br/>
					2. 保证美团外卖商家应用前台云行<br/>
					3. 请勿将设备锁屏，否则将影响自动接单<br/>
					4. 单量较大的商家请保证美团外卖商家应用独享一台<br/>
					打印机，否则可能出现多张小票混打乱码<br/>
					5. 自动接单仅对本设备生效
					                            
				</view>
			</view>
		</view>
		<!-- 弹出层 -->
		<u-popup v-model="show"  mode="center" width="88%">
			<view class="authorize">
				<view>请先授权通知使用权</view>
				<view>请自动接单开启之前，需先开启应用的通知使用权</view>
				<view>
					<view @tap="know">我知道了</view>
					<view @tap="open">继续开启</view>
				</view>
			</view>
		</u-popup>
		<view class="Login">保存</view>
	</view>
</template>
<script>
import { mapActions, mapState } from 'vuex';
import { toast } from '@/utils/toast';
import request from '@/utils/request';
import statusBar from '../../components/statusBar/statusBar.vue';
export default {
	data() {
		return {
			checked: false,
			show:false
		};
	},
	components: {
		statusBar
	},
	methods: {
		leftIndex() {
			uni.navigateBack({
				delta: 1
			});
		},
		// 我知道了
		know(){
			this.show = false
		},
		// 确认开启
		open(){
			this.show = false
			this.checked = true
			toast('设置成功');
		},
		change(status) {
			this.show = true
			this.checked = false
			
			console.log(status, 1111);
		}
	}
};
</script>
<style lang="scss" scoped>
.OrderSetup {
	.nav {
		display: flex;
		align-items: center;
		padding: 50upx 30upx 31upx 30upx;
		background: $bg1-color;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 9999;
		
		image {
			width: 27upx;
			height: 30upx;
			display: flex;
		}
		& > view {
			font-size: 34upx;
			font-family: Source Han Sans CN;
			font-weight: bold;
			color: $bg2-color;
			margin-left: 30upx;
		}
	}
	.stores {
		padding-top: 100upx;
		background: #ffffff;
		& > view:nth-child(1) {
			background: $bg1-color;
			padding: 32upx 26upx 0upx 26upx;
			& > view:nth-child(1) {
				display: flex;
				align-items: center;
				justify-content: space-between;
				& > view:nth-child(1) {
					font-size: 38upx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: $bg3-color;
				}
			}
			& > view:nth-child(2) {
				font-size: 28upx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: $bg5-color;
				margin-top: 30upx;
				border-bottom: 1upx solid #EDEFF9;
				padding-bottom: 30upx;
			}
			& > view:nth-child(3) {
				display: flex;
				align-items: center;
				margin-top: 60upx;
				border-bottom: 1upx solid #EDEFF9;
				padding-bottom: 30upx;
				& > view:nth-child(1) {
					image{
						width: 36upx;
						height: 36upx;
						display: flex;
					}
				}
				& > view:nth-child(2) {
					font-size:34upx;
					font-family:Source Han Sans CN;
					font-weight:400;
					color:$bg2-color;
					margin-left: 25upx;
					
				}
			}
			& > view:nth-child(4) {
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-bottom: 1upx solid #EDEFF9;
				padding: 30upx 0upx 30upx 0upx;
				& > view:nth-child(1) {
					display: flex;
					align-items: center;
					& > view:nth-child(1) {
						image{
							width: 36upx;
							height: 36upx;
							display: flex;
						}
					}
					& > view:nth-child(2) {
						font-size:34upx;
						font-family:Source Han Sans CN;
						font-weight:400;
						color:$bg2-color;
						margin-left: 25upx;
						
					}
				}
				& > view:nth-child(2) {
					image{
						width: 27upx;
						height: 30upx;
					}
				}
			}
			// 打印机
			& > view:nth-child(5){
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-bottom: 1upx solid #EDEFF9;
				padding: 30upx 0upx 30upx 0upx;
				& > view:nth-child(1){
					display: flex;
					align-items: center;
					& > view:nth-child(1) {
						image{
							width: 36upx;
							height: 36upx;
							display: flex;
						}
					}
					& > view:nth-child(2) {
						font-size:34upx;
						font-family:Source Han Sans CN;
						font-weight:400;
						color:$bg2-color;
						margin-left: 25upx;
						
					}
				}
				& > view:nth-child(2){
					display: flex;
					align-items: center;
					& > view:nth-child(1) {
						font-size:30upx;
						font-family:Source Han Sans CN;
						font-weight:400;
						color:$bg5-color;
						margin-right: 25upx;
					}
					& > view:nth-child(2) {
						image{
							width: 27upx;
							height: 30upx;
							display: flex;
						}
					}
				}
			}
			// 去开启
			& > view:nth-child(6){
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-bottom: 1upx solid #EDEFF9;
				padding: 30upx 0upx 30upx 0upx;
				& > view:nth-child(1){
					display: flex;
					align-items: center;
					& > view:nth-child(1) {
						image{
							width: 36upx;
							height: 36upx;
							display: flex;
						}
					}
					& > view:nth-child(2) {
						font-size:34upx;
						font-family:Source Han Sans CN;
						font-weight:400;
						color:$bg2-color;
						margin-left: 25upx;
						
					}
				}
				& > view:nth-child(2){
					display: flex;
					align-items: center;
					& > view:nth-child(1) {
						font-size:30upx;
						font-family:Source Han Sans CN;
						font-weight:400;
						color:$bg5-color;
						margin-right: 25upx;
					}
					& > view:nth-child(2) {
						image{
							width: 27upx;
							height: 30upx;
							display: flex;
						}
					}
				}
			}
			& > view:nth-child(7){
				font-size:28upx;
				font-family:Source Han Sans CN;
				font-weight:400;
				color:$bg5-color;
				line-height: 46upx;
				margin-top: 30upx;
			}
			
			
		}
	}
	.Login {
		width: 93%;
		height: 112upx;
		margin: 0 auto;
		background: rgba(53, 57, 76, 1);
		border-radius: 56upx;
		font-size: 34upx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: $bg1-color;
		position: fixed;
		bottom: 36upx;
		left: 0;
		right: 0;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.authorize{
		text-align: center;
		&>view:nth-child(1){
			font-size:38upx;
			font-family:Source Han Sans CN;
			font-weight:400;
			color:$bg2-color;
			margin-top: 53upx;
		}
		&>view:nth-child(2){
			font-size:28upx;
			font-family:Source Han Sans CN;
			font-weight:400;
			color:$bg6-color;
			width: 75%;
			margin: 36upx auto;
		}
		&>view:nth-child(3){
			display: flex;
			align-items: center;
			border-top: 1upx solid #EDF0FA;
			&>view:nth-child(1){
				font-size:32upx;
				font-family:Source Han Sans CN;
				font-weight:bold;
				color:$bg6-color;
				height: 112upx;
				width: 50%;
				border-right: 1upx solid #EDF0FA;
				font-size:32upx;
				font-family:Source Han Sans CN;
				font-weight:bold;
				color:$bg6-color;
				display: flex;
				align-items: center;
				justify-content: center;
			}
			&>view:nth-child(2){
				font-size:32upx;
				font-family:Source Han Sans CN;
				font-weight:bold;
				color:$bg6-color;
				height: 112upx;
				width: 50%;
				
				font-size:32upx;
				font-family:Source Han Sans CN;
				font-weight:bold;
				color:$bg-color;
				display: flex;
				align-items: center;
				justify-content: center;
			}
		}
	}
}
</style>
